further cleanups for Format class header. (#683)
authortsteven4 <13596209+tsteven4@users.noreply.github.com>
Sat, 6 Feb 2021 17:51:41 +0000 (10:51 -0700)
committerGitHub <noreply@github.com>
Sat, 6 Feb 2021 17:51:41 +0000 (10:51 -0700)
manual fix for typedef found by clang-tidy modernize-use-using

clazy fixes for clazy-function-args-by-ref

clang-tidy fix for modernize-use-default-member-init

gui/format.h

index 4da1d5428c23496f027210428858e588fff757cb..237740b76dfa80388a67cc4865d9ae6f04435d9b 100644 (file)
 class FormatOption
 {
 public:
-  typedef enum {
+
+  /* Types */
+
+  enum optionType {
     OPTstring,
     OPTbool,
     OPTint,
@@ -39,16 +42,18 @@ public:
     OPTfloat,
     OPTinFile,
     OPToutFile,
-  } optionType;
+  };
+
+  /* Special Member Functions */
 
   FormatOption() = default;
   FormatOption(const QString& name,
                const QString& description,
                optionType type,
-               QVariant defaultValue = QVariant(),
-               QVariant minValue = QVariant(),
-               QVariant maxValue = QVariant(),
-               QString html = QString()
+               const QVariant& defaultValue = QVariant(),
+               const QVariant& minValue = QVariant(),
+               const QVariant& maxValue = QVariant(),
+               const QString& html = QString()
               ):
     name_(name),
     description_(description),
@@ -67,6 +72,8 @@ public:
     }
   }
 
+  /* Member Functions */
+
   QString  getName() const
   {
     return name_;
@@ -100,7 +107,7 @@ public:
     return defaultValue_;
   }
 
-  void setValue(QVariant v)
+  void setValue(const QVariant& v)
   {
     value_ = v;
   }
@@ -116,6 +123,9 @@ public:
   }
 
 private:
+
+  /* Data Members */
+
   QString name_;
   QString description_;
   optionType type_{OPTbool};
@@ -132,6 +142,9 @@ private:
 class Format
 {
 public:
+
+  /* Special Member Functions */
+
   Format() = default;
   Format(const QString& name,
          const QString& description,
@@ -157,7 +170,7 @@ public:
     writeRoutes_(writeRoutes),
     fileFormat_(fileFormat),
     deviceFormat_(deviceFormat),
-    hidden_(false),
+
     extensions_(extensions),
     inputOptions_(inputOptions),
     outputOptions_(outputOptions)
@@ -165,6 +178,8 @@ public:
     (void)html; // suppress 'unused' warning.
   }
 
+  /* Member Functions */
+
   bool isReadWaypoints() const
   {
     return readWaypoints_;
@@ -300,6 +315,9 @@ public:
   }
 
 private:
+
+  /* Data Members */
+
   QString name_;
   QString description_;
   bool readWaypoints_{false};